import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from sqstack import SqStack

#注意 两个栈不能直接比较 因为程序会去比较他们的地址
def is_pal(s):
    SStack = SqStack()
    # Push all characters onto the stack
    for char in s:
        SStack.push(char)
    
    # Compare original string with reversed (popped from stack)
    for char in s:
        if SStack.pop() != char:
            return False
    return True

if __name__ == "__main__":
    str1 = "aaaasss111"
    str2 = "aa"
    print(is_pal(str1))  # 应输出 False
    print(is_pal(str2))  # 应输出 True